﻿@using Models.WebSite_HaiSheng
@model List<Recruitment>
@Html.ActionLink("招聘创建", "Create")
@*@(Html.Telerik().Grid<Recruitment>().ClientEvents(e => e.OnError("bindingError")).Name("Recruitment").DataBinding(databinding => databinding.Ajax().Select("AjaxRecruitmentIndex", "Recruitment"))
                .DataKeys(keys =>
                {
                    keys.Add(s => s.ID);
                })
                .Columns(c =>
                {
                    c.Bound(item => item.JobTitle).Width(200);
                    c.Bound(item => item.JobPositionCount).Width(200);
                    c.Bound(item => item.Salary).Width(150);
                    c.Bound(item => item.ID).Title("操作").ClientTemplate("<a href='/Recruitment/edit/" + "<#= ID #>'>编辑</a> | <a href='/Recruitment/details/" + "<#= ID #>'>详细</a> | <a href='/Recruitment/delete/" + "<#= ID #>'>删除</a>"); 
                   })
                .Resizable(resizing => resizing.Columns(true))
                .Pageable(p => p.PageSize(20))
                .Sortable()
                .Scrollable(scrolling => scrolling.Height(350))
)*@

@(Html.Telerik().Grid<Recruitment>(Model).Name("Recruitment")
                .DataKeys(keys =>
                {
                    keys.Add(s => s.ID);
                })
                .Columns(c =>
                {
                    c.Bound(item => item.JobTitle).Width(200);
                    c.Bound(item => item.JobPositionCount).Width(200);
                    c.Bound(item => item.Salary).Width(150);
                    c.Bound(item => item.ID).Title("操作").Template(@<span>
                    <a href=@Url.Content("~/Recruitment/Edit/" + item.ID) >编辑</a> | <a href=@Url.Content("~/Recruitment/Details/" + item.ID)>详细</a> | <a href=@Url.Content("~/Recruitment/delete/" + item.ID) >删除</a> 
                   </span>);
                })
                 .DetailView(e => e.Template(
                        @<text>
                         @RenderGrid(item.JobApplys, item.ID)
                        </text>
                    ))
                .Resizable(resizing => resizing.Columns(true))
                .Pageable(p => p.PageSize(20))
                .Sortable()
                .Scrollable(scrolling => scrolling.Height(350))
)

@helper RenderGrid(List<JobApply> clients, int companyuid)
    { 
     @(Html.Telerik().Grid(clients).Name("JobApplys" + companyuid)
                            .Columns(c =>
                            {
                                c.Bound(item => item.Applyer).Width(200);
                                c.Bound(item => item.WorkingExperience).Width(200);
                                c.Bound(item => item.ExpectedSalary).Width(150);
                                c.Bound(item => item.ID).Title("操作").Template(@<span>
                    <a href=@Url.Content("~/JobApply/Edit/" + item.ID) >编辑</a> | <a href=@Url.Content("~/JobApply/Details/" + item.ID)>详细</a>  | <a href=@Url.Content("~/JobApply/delete/" + item.ID) >删除</a> 
                   </span>);
                            })
                                               .Resizable(resizing => resizing.Columns(true))
                                               .Pageable(p => p.PageSize(20))
                                               .Sortable())
} 